<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            display: flex;

        }
    </style>
</head>

<body>
    <div>
        <input type="button" value="-">
        <h3>0</h3>
        <input type="button" value="+">
    </div>
    <script>
        let clear = document.querySelector('[value="-"]');
        let add = document.querySelector('[value="+"]');
        let h3 = document.querySelector('h3');
        let i = 0;
        let number = 1;

        clear.onclick = function () {
            if(h3.innerText >0){
                h3.innerText--;
            }
        }
        add.onclick = function () {
            h3.innerText = number++;
        }
    </script>
</body>

</html>